home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / vbcc / machines / amigappc / libsrc / stdio / ftell.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-24  |  338 b   |  19 lines

  1. /*
  2. ** vbcc-Amiga-PowerPC version of ftell.c
  3. **
  4. ** v0.1 04.10.97 phx
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <powerup/gcclib/powerup_protos.h>
  9.  
  10. long ftell(FILE *f)
  11. {
  12.     long offset;
  13.     offset=PPCSeek((BPTR)f->filehandle,0L,0L);
  14.     if(f->flags&_READ) offset-=f->count;
  15.     if(f->flags&_WRITE) offset+=f->bufsize-f->count;
  16.     return(offset);
  17. }
  18.  
  19.